package com.example.boot_mq_consumer.com.mmall;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * @ClassName Queue_Consumer
 * @Description TODO
 * @Author wushaopei
 * @Date 2019/12/25 15:24
 * @Version 1.0
 */
@Component
public class Queue_Consumer {

    @JmsListener(destination = "${myqueue}")
    public void receive(TextMessage textMessage) throws JMSException {
        System.out.println("********消费者受到消息："+textMessage.getText());
    }

}
